#!/bin/sh
################################################################################
# web
################################################################################
. /etc/rc.d/functions

start() {
    /usr/bin/logger -s -t minimyth -p "local0.info" "[init.d/web] Starting..."

    /bin/chown -Rh root:httpd /srv/www

    /usr/sbin/lighttpd -f /etc/lighttpd-web.conf
    /usr/sbin/lighttpd -f /etc/lighttpd-dir.conf

    /usr/bin/logger -s -t minimyth -p "local0.info" "[init.d/web] Started with return code=0..."

    return 0
}

stop() {
    mm_message_output info "stopping web server ..."

    if [ -n "`/bin/pidof lighttpd`" ] ; then 
        /usr/bin/killall lighttpd
    fi

    return 0
}

case $1 in
    start) start ;;
    stop)  stop  ;;
esac

exit 0
